<!doctype html>
<html>
<head>
    <include file="Public/head"/>

    <link href="__CSS__/main.css" rel="stylesheet" type="text/css" />
    <link href="__CSS__/index.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="__JS__/jquery-2.1.0.min.js"></script>
    <script type="text/javascript" src="__JS__/jquery.spinner.js"></script>
    <link rel="stylesheet" href="__CSS__/jquery.spinner.css" />


    <style>
        .price {
            width: auto;
            padding: 0;
            margin-top: 0;
            border-top: 0;
            padding-top: 0;
            color: #ec5151;
            font-size: 1rem;
            display: inline-block;
            font-weight: bold;
        }

        .delete-ico{
            width: 1.5rem;
            height: 1.5rem;
            display: block;
            background-color: #CCC;
            position: absolute;
            right: 0.9rem;
            top: 0.9rem;
            -moz-border-radius: 0.75rem;
            -webkit-border-radius: 0.75rem;
            border-radius: 0.75rem;
            -webkit-background-size: 0.8rem 0.8rem;
            -moz-background-size: 0.8rem 0.8rem;
            background-size: 0.8rem 0.8rem;
        }
    </style>

</head>

<body style="background:#eee;">
<header id="header">
    <div class="header_l"> <a class="ico_10" href="javascript:history.go(-1);"> 返回 </a> </div>
    <h1 style="line-height: 50px;">购物车</h1>
    <!--<div class="header_r"><a class="edit" href="{:U('Cart/edit')}" style="text-indent:0;line-height: 50px;font-size: 16px;">编辑</a></div>-->
    <div class="header_r"><a class="edit" href="/" style="text-indent:0;line-height: 50px;font-size: 16px;">首页</a></div>
</header>

<div class="cart-content">
    <form id="form" action="{:U('Order/confirm')}" method="post" style="margin-bottom: 116px;">
        <volist name="carts" id="cart">
            <div class="cart-good cart-good-{$cart.id}" data-id="{$cart.id}" data-price="{$cart.price}" data-number="{$cart.number}" data-select="1" data-activity="{$cart.activity}">
                <div class="cart-radio">
                    <div class="cbt cb cb_active">
                        <input type="checkbox" hidden="hidden" name="cart_id[]" value="{$cart.id}" checked="checked">
                    </div>
                </div>
                <a href="{:U('Goods/detail',array('id'=>$cart['goods']['id']))}"><img src="http://{:C('DOMAIN')}{:get_item_imgs($cart['goods']['multimage'],1,'path')['path']}"></a>
                <div class="good-data cart-width">
                    <p><a href="{:U('Goods/detail',array('id'=>$cart['goods']['id']))}">{$cart.goods.title}</a></p>
                    {:hook("order_goods_show",$cart["tags"])}
                    <if condition="$cart['activity'] gt 0">
                        <p class="color-red">￥{$cart.price}</p><span class="fr">X<eq name="cart.number" value="0">1<else/>{$cart.number}</eq></span></p>
                        <p class="color-good"><s>￥<span >{$cart.goods.price}</span></s>
                        <else/>
                        <p class="color-good">￥<span class="price" data-id="{$cart.id}" data-number="{$cart.number}">{$cart.goods.price}</span>
                            <!--<span class="fr">X{$cart.number}</span>-->

                            <di class="spinner">
                                <button class="decrease" type="button" data-id="{$cart.id}" data-activity="{$cart.activity}">-</button>
                                <input type="text" class="spinnerExample value passive" class="fr" name="number" maxlength="2" value="{$cart.number}">
                                <button class="increase" type="button" data-id="{$cart.id}" data-activity="{$cart.activity}">+</button>
                            </di>
                        <a class="delete-ico ico_08" href="javascript:if (confirm('您确实要把该商品移出购物车吗？')) location.href='{:U('Cart/delete',array('cart_id'=>$cart['id']))}';"> </a>
                        </p>
                    </if>

                </div>
            </div>
        </volist>
    </form>


</div>





<footer class="toolbar" style="box-sizing: border-box;padding-left: 3%;height: 45px;line-height: 45px;">
    <div class="cbt all cb cb_active" name="checkAll" type="checkbox"></div>全选
   <div style="float:right; margin-right:52%;"> 合计: <em class="price" id="goods_subtotal">￥<span class="color-red size total" >{$total}</span></em></div>
    <a class="settlement" href="javascript:void(0);">结算</a>
    <script>
        $(function(){
            $(".settlement").on('click',function(){
                $("#form").submit();
            });
        });
    </script>
</footer>
<include file="script"/>
</body>
</html>
